package org.SoccerTournament.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table (name = "Games")
public class Game implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
	private Date gameDate;
	
	private Long id;
	
	private Stadium theStadium;

	@Transient
	private Event event;

//	@Transient
//	private WorkFlow workFlow;
	
	
	@OneToOne(cascade = CascadeType.ALL,fetch = FetchType.LAZY)
	@JoinColumn(name = "stadiumId")
	public Stadium getTheStadium() {
		return theStadium;
	}
	
	public void setTheStadium(Stadium theStadium) {
		this.theStadium = theStadium;
	}
	
//	public WorkFlow getWorkFlow() {
//		return workFlow;
//	}
//	
//	public void setWorkFlow(WorkFlow workFlow) {
//		this.workFlow = workFlow;
//	}
	
	
//	@OneToOne(cascade = CascadeType.ALL,fetch = FetchType.LAZY)
//	@JoinColumn(name="eventId")
	public Event getEvent() {
		return event;
	}
	
	public void setEvent(Event event) {
		this.event = event;
	}
	
	@Column(name = "gameDate")
	public Date getGameDate() {
		return gameDate;
	}
	
	public void setGameDate(Date gameDate) {
		this.gameDate = gameDate;
	}

	@Id
	@GeneratedValue
	@Column(name="gameId")
	public Long getId() {
		return id;
	}
	
	public void setId(Long id) {
		this.id = id;
	}
}
